package com.heima.user.controller;

import com.heima.model.behavior.dtos.ArticleInfoDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.UserRelationDto;
import com.heima.model.user.dtos.UserRelationDto;
import com.heima.model.user.pojos.ApUser;
import com.heima.user.service.ApUserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/api/v1/user")
@RequiredArgsConstructor
public class ApUserController {

    private final ApUserService apUserService;

    @PostMapping("/query")
    public ApUser queryUser(@RequestBody ApUser user) {
        return apUserService.queryUser(user.getId());
    }
    @PostMapping("/user_follow")
    public ResponseResult userFollow(@RequestBody UserRelationDto dto) {
        return apUserService.userFollow(dto);
    }
    @PostMapping("/user_follow_info")
    public ResponseResult userFollowInfo(@RequestBody ArticleInfoDto dto) {
        return apUserService.userFollowInfo(dto);
    }
}
